package com.example.blockchain.utils;

public class SQLManager {
	public static final String getBlockSql(String index) {
		String sql = "CREATE TABLE IF NOT EXISTS [block" + index + "] (" + 
				"[ID] INTEGER  PRIMARY KEY AUTOINCREMENT NOT NULL," + 
				"[blockIndex] TEXT  NOT NULL," +
				"[preBlockHash] VARCHAR(300)  NOT NULL," +
				"[path] VARCHAR(300)  UNIQUE NOT NULL," + 
				"[createTime]  VARCHAR(50)  NOT NULL," + 
				"[blockHash] VARCHAR(300)  UNIQUE NOT NULL," +
				"[randomNumber] TEXT  NOT NULL," +
				"[onMingChain] INTEGER DEFAULT '0' NOT NULL" +
				")";
		return sql;
	}
	public static final String getPendingSql() {
		String sql = "CREATE TABLE IF NOT EXISTS [pending] (" + 
				"[orderNo] VARCHAR(200)  UNIQUE NOT NULL," + 
				"[tradeBody] TEXT  NOT NULL," +
				"[tradeType] VARCHAR(1)  NULL," + 
				"[createTime] VARCHAR(50) NOT NULL" + 
				")";
		return sql;
	}

	public static final String getDicSql() {
		String sql = "CREATE TABLE IF NOT EXISTS [dictionary] (" +
				"[module] VARCHAR(20)  NOT NULL," +
				"[key] VARCHAR(20)  NOT NULL," +
				"[value] VARCHAR(20)  NOT NULL" +
				")";
		return sql;
	}

}
